package dao

import (
	"RestaurantApp/model"
	"github.com/wonderivan/logger"
)

type CategoryDao struct {
}

func (this *CategoryDao) FindCategory() []model.FoodCategory {
	categories := []model.FoodCategory{}
	queryWrapper := model.FoodCategory{
		IsInServing: true,
	}
	err := model.DB.Where(queryWrapper).Find(&categories)
	if err != nil {
		logger.Error(err.Error)
	}
	return categories

}
